package dbf;

import java.lang.*;
import java.util.*;
import java.text.*;
import java.sql.*;

public class dbf {

	static public void main(String[] args) throws Exception {

		try {
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver ").newInstance();
			Connection conn = null;
			String url = "jdbc:odbc:DRIVER={MICROSOFT   FOXPRO   VFP   DRIVER   (*.DBF)};SourceType=DBF;SourceDB=d:\\test\\ ";

			conn = DriverManager.getConnection(url);

			Statement statmnt = conn.createStatement();

			int rt = statmnt
					.executeUpdate("insert   into   table1(id,name)   values(1, 'abc ') ");

			ResultSet reslts = statmnt
					.executeQuery("Select   *   from   table1 ");
			while (reslts.next()) {// while
				System.out.println(reslts.getString("id ") + "   "
						+ reslts.getString("name "));
			}// end while

		} catch (Exception e) {// catch
			e.printStackTrace();
			System.out
					.println("Well,   something   really   didn 't   work   out   that   well!!! ");
		}// end catch

	}

}
